<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>一隅立画</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
		<link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
		<link rel="stylesheet" type="text/css" href="./css/examine.css" />
		<link rel="stylesheet" type="text/css" href="./css/basestyle.css" />
		<script src="js/head.js" type="text/javascript"></script>
		<script src="js/xshead.js" type="text/javascript"></script>
		<script src="js/base.js"></script>
	</head>
	<body style="background-color: #f2f3f5;">
		<!-- 中间部分 -->
		<div class="content">
			<div class="container">
				<div class="row">
					<div id="rightside" class="col-lg-8 col-md-8">
						<!-- 竞赛详情 -->
						<div ref="allpopup" style="display: none;">
							<div class="racedetail">
								<div class="racedetailinfo">
									<div class="racedetailtitle">
										<p v-show="languagestatus == 1">{{pagelist.title}}</p>
										<p v-show="languagestatus == 2">{{pagelist.titleE}}</p>
									</div>
									<div class="racedetailstatus">
										<div class="racedetailstatustitle">
											<div class="racedetailstatustitletxt">
												<p v-show="languagestatus == 1">审核状态：</p>
												<p v-show="languagestatus == 2">Audit status：</p>
											</div>
											<div class="racedetailstatustitlewarp">
												<p v-show="pagelist.status == 0 && languagestatus == 1">审核中</p>
												<p v-show="pagelist.status == 2 && languagestatus == 1">审核未通过</p>
												<p v-show="pagelist.remove == 1 && languagestatus == 1 ">已撤销</p>
												<p v-show="pagelist.remove == 2 && languagestatus == 1">已退款</p>
												<p v-show="pagelist.status == 0 && languagestatus == 2">Under review</p>
												<p v-show="pagelist.status == 2 && languagestatus == 2">Failed to pass the audit</p>
												<p v-show="pagelist.remove == 1 && languagestatus == 2">Rescinded</p>
												<p v-show="pagelist.remove == 2 && languagestatus == 2">Refunded</p>
											</div>
										</div>
										<div class="racedetailstatusreason" v-show="pagelist.status == 2">
											<div class="racedetailstatusreasontitle">
												<p v-show="languagestatus == 1">未通过原因：</p>
												<p v-show="languagestatus == 2">Reasons for failure：</p>
											</div>
											<div class="racedetailstatusreasonwarp">
												<p v-show="languagestatus == 1">{{pagelist.deadtext}}</p>
												<p v-show="languagestatus == 2">{{pagelist.deadtextE}}</p>
											</div>
										</div>
									</div>
									<div class="racedetailpeo">
										<div class="racedetailpeoimg">
											<div class="racedetailpeoimgle">
												<div class="racedetailpeoimgleimg">
													<img :src="pagelist.avatar">
												</div>
												<div class="racedetailpeoimglename">
													<p>{{pagelist.nickname}}</p>
												</div>
											</div>
											<div class="racedetailpeoimgri">
												<img v-show="pagelist.collstatus == 0" src="./images/weishoucnag.png">
												<img v-show="pagelist.collstatus == 1" src="./images/yishoucang.png" >
											</div>
										</div>
										<div class="racedetailpeodata">
											<div class="racedetailpeodatatime">
												<div class="racedetailpeodatatimeimg">
													<img src="./images/data.png">
												</div>
												<div class="racedetailpeodatatimewarp">
													<p>{{pagelist.createtime}}</p>
												</div>
											</div>
											<div class="racedetailpeodatanum">
												<div class="racedetailpeodatanumimg">
													<img src="./images/browse_num.png">
												</div>
												<div class="racedetailpeodatanumtxt">
													<p>{{pagelist.views}}</p>
												</div>
											</div>
										</div>
									</div>
									<div class="racedetailline"></div>
								</div>
								<div class="racedetailwarp">
									<!-- 富文本 -->
									<div class=""  v-show="languagestatus == 1" v-html="pagelist.describecontent"></div>
									<div class=""  v-show="languagestatus == 2" v-html="pagelist.describecontentE"></div>
									<!-- 竞赛 -->
									<div class="racedetailwarpdown">
							
										<div class="racedetailwarpdownracetime">
											<div class="racedetailwarpdownracetimetitle">
												<p v-show="languagestatus == 1">竞赛时间</p>
												<p v-show="languagestatus == 2">Competition time</p>
											</div>
											<div class="racedetailwarpdownracetimedata">
												<p v-show="languagestatus==1">截止至：</p>
												<p v-show="languagestatus==2">As of：</p>
												<p>{{pagelist.endtime}}</p>
											</div>
										</div>
										<div class="racedetailwarpdownracemoney">
											<div class="racedetailwarpdownracemoneytitle">
												<p v-show="languagestatus==1">竞赛奖金</p>
												<p v-show="languagestatus==2">Competition bonus</p>
											</div>
											<div class="racedetailwarpdownracemoneywarp">
												<div class="racedetailwarpdownracemoneywarpnav">
													<div class="totalbonus">
														<p v-show="languagestatus==1">奖金总额：</p>
														<p v-show="languagestatus==2">Total bonus：</p>
														<p>￥{{pagelist.money}}</p>
													</div>
													<div class="totalbonuschlidone totalbonuschilditem" v-for="(reward,index) in rewardlist" :key="index">
														<p v-show="languagestatus==1">{{reward.name}}</p>
														<p v-show="languagestatus==2">{{reward.nameE}}</p>
														<div class="totalbonuschildnav">
															<p>{{reward.value}}</p>
															<!-- <p>元</p> -->
														</div>
													</div>
												</div>
												<div class="racedetailwarpdownracemoneywarpdeduct">
													<p v-show="languagestatus== 1">*已扣除5％的平台金</p>
													<p v-show="languagestatus== 2">*5% of the platform fee has been deducted</p>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div id="raceside" class="col-lg-4 col-md-4">
						<script src="js/racesidebar.js" type="text/javascript"></script>
					</div>
				</div>
			</div>
		</div>
		<script src="js/pcFooter.js" type="text/javascript"></script>
		<script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
		<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
		<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
		<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.0/axios.min.js"></script>
		<script type="text/javascript">
			

			let rightside = new Vue({
				el: '#rightside',
				data: {
					pagelist: [],
					rewardlist: [],
					pageId: '',
					userid:'',
					token:'',
					loginstatus:0,
					examinestatus:[],
					raceid:'',
					remove:'',
					languagestatus:''
				},
				created:function() {
					if (sessionStorage.getItem('languagestatus')) {
						let languagestatus = sessionStorage.getItem('languagestatus')
						this.languagestatus = languagestatus
					}
				},
				mounted:function() {
					let that = this
					var url = location.search
					var theRequest = new Object()
					if (url.indexOf("?") != -1) {
						var str = url.substr(1); //substr()方法返回从参数值开始到结束的字符串；  
						var strs = str.split("&");
						for (var i = 0; i < strs.length; i++) {
							theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1]);
						}
						// console.log( theRequest ); //此时的theRequest就是我们需要的参数；  
						that.pageId = theRequest.id
						console.log(url)
					}
					if (sessionStorage.getItem('userinfo')) {
						console.log('isdfksjdf sd')
						let obj = JSON.parse(sessionStorage.getItem('userinfo'));
						console.log(obj)
						that.loginstatus = 1
						that.userid = obj.userid
						that.token = obj.token
						that.getpagelist()
					}
					this.$refs.allpopup.style.display = 'block'
				},
				methods: {
					// 时间戳
					add0(m){return m<10?'0'+m:m },
					getLocalTime(nS) {
					   let time = new Date(parseInt(nS)*1000);
					   var y = time.getFullYear();
					   var m = time.getMonth()+1;
					   var d = time.getDate();
					   var h = time.getHours();
					   var mm = time.getMinutes();
					   var s = time.getSeconds();
					   return y+'/'+this.add0(m)+'/'+this.add0(d)+' '+this.add0(h)+':'+this.add0(mm);
					},
					// 获取数据
					getpagelist: function() {
						let that = this
						axios.get('http://admin.yiyulihua.com/api/sheji.competition/details', {
							params: {
								id:that.pageId,
								userid:that.userid,
								token:that.token
							}
						})
						.then((res) => {
							if(res.data.code == 1){
								that.pagelist = res.data.data.competition
								that.rewardlist = res.data.data.competition.reward
								that.raceid = res.data.data.competition.id
								that.remove = res.data.data.competition.remove
								that.pagelist.createtime = that.getLocalTime(res.data.data.competition.createtime)
								that.pagelist.endtime = that.getLocalTime(res.data.data.competition.endtime)
							}
							console.log(that.pagelist)
						})
					},
				}
			})
			
		</script>
	</body>
</html>
